package router

import (
	"database/sql"

	"gitee.com/hp-huiw/family-expense-api/internal/handler"
	"github.com/gin-gonic/gin"
)

// Sets routes for authentication resource.
func SetAuthenticationRoutes(routerGroup *gin.RouterGroup, db *sql.DB) {
	h := handler.NewAuthenticationHandler(db)

	routerGroup.GET("/check-on-username", h.CheckOnUsername)
	routerGroup.POST("/register", h.Register)
	routerGroup.POST("/unregister", h.Unregister)
	routerGroup.POST("/login", h.Login)
	routerGroup.POST("/refresh-token", h.RefreshToken)
	routerGroup.POST("/switch-account-group", h.SwitchAccountGroup)
	routerGroup.POST("/logout", h.Logout)
}
